import { Schema as _Schema, model } from "mongoose";
const Schema = _Schema;

const ResourceSchema = new Schema({
    data: {
        type: Schema.Types.Buffer,
        required: true,
    },
    course: {
        type: Schema.Types.ObjectId,
        ref: 'course',
    },
    uploader: {
        type: Schema.Types.ObjectId,
        ref: 'user',
    },
    score: {
        type: Number,
    },
    tags: {
        type: [String],
    },
});

const Resource = model("resource", ResourceSchema);

export default Resource;
